﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Agr.CQRS.Domain;

namespace Tests.Agr.CQRS.Domain
{
    [TestClass]
    public class When_New_AggregateRoot_Is_Created
    {
        private aggrRootImp target;

        [TestInitialize]
        public void TestInitialize()
        {
            //Given
            target = new aggrRootImp();

            //When
            target.CreateNew(Guid.NewGuid());
        }
        

        [TestMethod()]
        public void Then_The_New_Id_Is_Set()
        {
            Assert.AreNotEqual(Guid.Empty, target.Id);
        }

        
        [TestMethod()]
        public void Then_The_Version_Is_Set_To_0()
        {
            Assert.AreEqual(0, target.Version);
        }

        private class aggrRootImp : AggregateRoot 
        {
        }
    }

}
